package com.mmc.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mmc.entity.Message;

import java.util.List;

/**
 * 消息服务接口
 *
 * @author kunfe
 * @since 2024-01-01
 */
public interface MessageService extends IService<Message> {

    /**
     * 发送消息
     */
    boolean sendMessage(Message message);

    /**
     * 批量发送消息
     */
    boolean batchSendMessage(List<Long> receiverIds, String title, String content, Integer type);

    /**
     * 分页查询用户消息
     */
    Page<Message> getMessagePage(Page<Message> page, Long receiverId, Integer type, Integer status);

    /**
     * 获取未读消息数量
     */
    Long getUnreadCount(Long receiverId);

    /**
     * 标记消息为已读
     */
    boolean markAsRead(Long messageId, Long receiverId);

    /**
     * 批量标记消息为已读
     */
    boolean batchMarkAsRead(List<Long> messageIds, Long receiverId);

    /**
     * 删除消息
     */
    boolean deleteMessage(Long messageId, Long receiverId);

    /**
     * 批量删除消息
     */
    boolean batchDeleteMessage(List<Long> messageIds, Long receiverId);

    /**
     * 获取最新消息（用于实时推送）
     */
    List<Message> getLatestMessages(Long receiverId, Integer limit);

    /**
     * 全部标记为已读
     */
    boolean markAllAsRead(Long receiverId);

    /**
     * 系统广播消息
     */
    boolean broadcastMessage(String title, String content, Integer type);
} 